package com.example.pos_terminal;

import android.app.Presentation;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.media.MediaRouter;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.tencent.smtt.export.external.interfaces.ConsoleMessage;
import com.tencent.smtt.sdk.WebChromeClient;
import com.tencent.smtt.sdk.WebView;

public class HelpHandPresentation extends Presentation {

    private X5WebView mWebView;
    private BroadcastReceiver MyReceiver;
    private Context context;
    private String mDoubleScreen;
    private View contentView;
    private String url;
    public HelpHandPresentation(Context outerContext, Display display, String url) {
        super(outerContext, display);
        this.url =url;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mWebView = findViewById(R.id.webview);
        mWebView.loadUrl("file:///android_asset/vue/"+url);
    }

    public void progressChange(String url) {
        if (url != null)
            this.url = url;
        mWebView.loadUrl("file:///android_asset/vue/"+url);

    }


    @Override
    public void setOnDismissListener(@Nullable OnDismissListener listener) {
        super.setOnDismissListener(listener);
    }

     public void stop(){
       View view= this.getWindow().getDecorView();
       if(view!=null){
           view.setVisibility(View.GONE);
       }
    }

    @Override
    protected void onStop() {
        super.onStop();
    }
}
